home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb11.zip / LOGICDEV.PAS < prev    next >
Pascal/Delphi Source File  |  1985-11-05  |  658b  |  31 lines

  1. PROGRAM DeviceAssignmentDemo;
  2. {
  3. This program demonstrates the redirection of output to different
  4. devices, under program control.
  5.  
  6. Source: "Selecting Output Devices From A Program", TUG Lines Volume I Issue 5
  7. Author: Dwight William Johnson
  8. Application: All systems
  9. }
  10.  
  11. var
  12.   FileVar: text;
  13.   InKey: char;
  14.   Input: string[40];
  15. begin
  16.   ClrScr;
  17.   write(' (S)creen or (P)rinter output? ');
  18.   repeat
  19.     read(kbd,InKey);
  20.     InKey:=Upcase(InKey);
  21.   until InKey in ['S','P'];
  22.   writeln;
  23.   if InKey='S' then
  24.     assign(FileVar,'con:')
  25.   else
  26.     assign(FileVar,'lst:');
  27.   reset(FileVar);
  28.   readln(Input);
  29.   writeln(FileVar,Input);
  30. end.
  31.